import React, { useState } from 'react';
import { Button, Form, Row, Col, Select, Input, InputNumber, DatePicker } from 'antd';
// import { connect } from 'dva';
// import request from '@/utils/request';
const { Option } = Select;

function Operpage(props) {
  const { getFieldDecorator } = props.form;
  return (
    <>
      <Form layout="vertical">
        <Row gutter={16}>
          <Col span={12}>
            <Form.Item label="工号池ID">
              {getFieldDecorator('systemSource')(
                <Input allowClear placeholder="请输入" disabled={props.disabled} />
              )}
            </Form.Item>
          </Col>
          <Col span={12}>
            <Form.Item label="号池名称">
              {getFieldDecorator('queryType', {
                rules: [{ required: true, message: '请输入' }],
              })(<Input allowClear placeholder="请输入" disabled={props.disabled} />)}
            </Form.Item>
          </Col>
        </Row>
        <Row gutter={16}>
          <Col span={12}>
            <Form.Item label="每次分配最大数量">
              {getFieldDecorator('exceptionCode', {
                rules: [{ required: true, message: '请输入' }],
              })(<Input allowClear placeholder="请输入" disabled={props.disabled} />)}
            </Form.Item>
          </Col>
          <Col span={12}>
            <Form.Item label="预占时间（分）">
              {getFieldDecorator('outeroId', {
                rules: [{ required: true, message: '请输入' }],
              })(
                <InputNumber
                  style={{ width: '100%' }}
                  allowClear
                  placeholder="请输入"
                  disabled={props.disabled}
                />
              )}
            </Form.Item>
          </Col>
        </Row>
        <Row gutter={16}>
          <Col span={12}>
            <Form.Item label="状态">
              {getFieldDecorator('outerossrdId', {
                rules: [{ required: true, message: '请选择' }],
              })(
                <Select placeholder="请选择" disabled={props.disabled}>
                  <Option value="1">启用</Option>
                  <Option value="2">停用</Option>
                </Select>
              )}
            </Form.Item>
          </Col>
          <Col span={12}>
            <Form.Item label="号池类型">
              {getFieldDecorator('xssId', {
                rules: [{ required: true, message: '请选择' }],
              })(
                <Select placeholder="请选择" disabled={props.disabled}>
                  <Option value="1">工号池</Option>
                  <Option value="2">岗位池</Option>
                  <Option value="2">组织池</Option>
                </Select>
              )}
            </Form.Item>
          </Col>
        </Row>
        <Row gutter={16}>
          <Col span={12}>
            <Form.Item label="创建人">
              {getFieldDecorator('sdsd')(
                <Input allowClear placeholder="请输入" disabled={props.disabled} />
              )}
            </Form.Item>
          </Col>
          <Col span={12}>
            <Form.Item label="创建时间">
              {getFieldDecorator('xsaassd')(
                <DatePicker
                  style={{ width: '100%' }}
                  showTime
                  format="YYYY-MM-DD HH:mm:ss"
                  allowClear
                  disabled={props.disabled}
                />
              )}
            </Form.Item>
          </Col>
        </Row>
      </Form>
      <div
        style={{
          position: 'absolute',
          right: 0,
          bottom: 0,
          width: '100%',
          borderTop: '1px solid #e9e9e9',
          padding: '10px 16px',
          background: '#fff',
          textAlign: 'right',
        }}
      >
        {props.status === 'add' ? (
          <Button type="primary">新增工号池</Button>
        ) : props.status === 'edit' ? (
          <Button type="primary">修改工号池</Button>
        ) : null}
        <Button type="ghost" className="margin-left" onClick={props.close}>
          取消
        </Button>
      </div>
    </>
  );
}

export default Form.create()(Operpage);
